diff options
author | eug-vs <eugene@eug-vs.xyz> | 2022-10-23 01:30:18 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2022-10-23 01:30:18 +0300 |
commit | ad393f4243a10f9a5ab0ecd8afa5e6c07a088f5d (patch) | |
tree | 8f5758b8c1509269cae297a80f1bbfb10b68fd03 /src/pages/[...path].tsx | |
parent | 21a182985b7fa0c55691d5595b807dfcce2f4631 (diff) | |
download | benzin-next-ad393f4243a10f9a5ab0ecd8afa5e6c07a088f5d.tar.gz |
feat: add pre-render hook
Diffstat (limited to 'src/pages/[...path].tsx')
-rw-r--r-- | src/pages/[...path].tsx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pages/[...path].tsx b/src/pages/[...path].tsx index 9f55cf8..cf5db8c 100644 --- a/src/pages/[...path].tsx +++ b/src/pages/[...path].tsx @@ -29,12 +29,14 @@ export const getStaticProps = async (context: GetStaticPropsContext) => { : [context.params?.path] ); - const markdownSource = await benzinConfig.adapter.getMarkdownSource(benzinConfig.CDN, path); + const originalSource = await benzinConfig.adapter.getMarkdownSource(benzinConfig.CDN, path); + const sourceWithHooks = await benzinConfig.hooks.preRender(path, originalSource, benzinConfig.adapter, benzinConfig.CDN); + const emojiFileNames = await benzinConfig.adapter.getEmojiFileNames(benzinConfig.CDN, benzinConfig.paths.emojiRoot); return { props: { - markdownSource, + markdownSource: sourceWithHooks, emojiFileNames, path, } |